package com.jvyou.app.ds.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jvyou.app.ds.domain.entity.QuestionOption;
import com.jvyou.app.ds.mapper.QuestionOptionMapper;
import com.jvyou.app.ds.service.QuestionOptionService;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 题目选项表(QuestionOption)表服务实现类
 *
 * @author 橘柚
 * @since 2025-04-20 22:44:21
 */
@Service("questionOptionService")
public class QuestionOptionServiceImpl extends ServiceImpl<QuestionOptionMapper, QuestionOption> implements QuestionOptionService {

    @Override
    public List<QuestionOption> getByQuestion(Long questionId) {
        LambdaQueryWrapper<QuestionOption> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(QuestionOption::getQuestionId, questionId);
        wrapper.orderByAsc(QuestionOption::getSortOrder);
        return list(wrapper);
    }
}
